import { Middleware } from 'koa';
import { last } from 'lodash-es';

function onlyMine(): Middleware {
  return async (ctx, next) => {
    const id = last(ctx.path.split('/'));
    const authUser = ctx.state.user;

    console.log("user", authUser);

    console.log(JSON.stringify(ctx));

    strapi.documents("api::system-config.system-config")

    console.log("@@@", ctx.path)

    await next();

  }
}

export default onlyMine;